<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
    <meta content="" name="description">
    <meta content="" name="author">

    <title>用户新增</title>
    <link th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/asserts/css/font-awesome.min.css}" rel="stylesheet">
    <link th:href="@{/asserts/css/plugins/footable/footable.core.css}" rel="stylesheet">
    <link href="asserts/css/bootstrap-select.min.css" rel="stylesheet"
          th:href="@{/asserts/css/bootstrap-select.min.css}">
    <link th:href="@{/asserts/css/animate.min.css}" rel="stylesheet">
    <link th:href="@{/asserts/css/style.min.css}" rel="stylesheet">
    <link th:href="@{/asserts/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet">
    <link th:href="@{/asserts/js/layer/laydate/skins/default/laydate.css}" rel="stylesheet">
    <link th:href="@{/asserts/js/layer/laydate/need/laydate.css}" rel="stylesheet">

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content  animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 class="col-sm-10 padding-top-10">[[${largeSubstationSelected!=null}?用户编辑:用户新增]]</h5>
                    <div class="col-sm-2 text-right"><a href="javascript:history.back(-1)">返回</a></div>
                </div>

                <div class="ibox-content">
                    <form th:action="@{/sysuser/do}" th:method="post">
                        <input name="_method" th:if="${sysUserSelected!=null}" type="hidden" value="PUT"/>
                        <input name="uuid" th:value="${sysUserSelected!=null}?${sysUserSelected.uuid}" type="hidden"/>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold" for="orgName">[[#{message.department}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <div th:if="${sysOrgSelected!=null}">
                                    <input class="form-control" id="orgName" name="orgName" placeholder="orgName" readonly
                                           th:value="${sysOrgSelected.name}" type="text">
                                    <input class="form-control" id="orgId" name="orgId" placeholder="sysOrgSelected"
                                           th:value="${sysOrgSelected.uuid}" type="hidden">
                                </div>
                                <div th:if="${sysUserSelected!=null&&sysUserSelected.userOrg!=null}">
                                    <input class="form-control"  name="orgName" placeholder="orgName" readonly
                                           th:value="${sysUserSelected.userOrg.name}" type="text">
                                    <input class="form-control"  name="orgId" placeholder="sysUserSelected"
                                           th:value="${sysUserSelected.orgId}" type="hidden">
                                </div>
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">[[#{message.user.name}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="userName" name="userName" placeholder="name"
                                       th:placeholder="#{message.user.name}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.userName}" type="text" required>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">[[#{message.name}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="name" name="name" placeholder="name"
                                       th:placeholder="#{message.name}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.name}" type="text" required>
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">菜单操作角色<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="selectpicker roleSelectpicker" data-live-search="false" multiple
                                        name="roles">
                                    <option th:each="f:${userRolesSelection}" th:text="${f.name}" th:value="${f.uuid}">
                                        Choose...
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">数据角色<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="selectpicker dataRoleSelectpicker" data-live-search="false" multiple
                                        name="dataRoles">
                                    <option th:each="f:${userDataRolesSelection}" th:text="${f.name}" th:value="${f.uuid}">
                                        Choose...
                                    </option>
                                </select>
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">岗位<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="selectpicker auditRoleSelectpicker" data-live-search="false" multiple
                                        name="auditRoles">
                                    <option th:each="f:${map}" th:text="${f.value}" th:value="${f.key}">
                                        Choose...
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold">所属公司<span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="form-control m-b" name="companyId" >
                                    <option th:each="f:${company}" th:text="${f.name}" th:value="${f.uuid}"
                                            th:selected="${sysUserSelected!=null}?${sysUserSelected.companyId}==${f.uuid}">
                                </select>
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold">所属租赁公司<span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="form-control m-b" name="rentCompanyId">
                                    <option th:each="f:${rentCompany}" th:text="${f.name}" th:value="${f.uuid}"
                                            th:selected="${sysUserSelected!=null}?${sysUserSelected.rentCompanyId}==${f.uuid}">
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold">所属二级单位<span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <select class="form-control m-b" name="parentCompanyId">
                                    <option th:each="f:${twoLevelCompany}" th:text="${f.name}" th:value="${f.uuid}"
                                            th:selected="${sysUserSelected!=null}?${sysUserSelected.parentCompanyId}==${f.uuid}">
                                </select>
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold" for="userIdentity">[[#{message.user.identity}]]<span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="userIdentity" name="userIdentity"
                                       placeholder="userIdentity"
                                       th:placeholder="#{message.user.identity}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.userIdentity}" type="text">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">[[#{message.user.email}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="email" name="email" placeholder="email"
                                       th:placeholder="#{message.user.email}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.email}" type="text">
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userIdentity">[[#{message.user.address}]]
                            <span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="address" name="address" placeholder="address"
                                       th:placeholder="#{message.user.address}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.address}" type="text">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">[[#{message.user.phone}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="phone" name="phone" placeholder="phone"
                                       th:placeholder="#{message.user.phone}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.phone}" type="text">
                            </div>
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userIdentity">[[#{message.user.fax}]]
                            <span style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="fax" name="fax" placeholder="fax"
                                       th:placeholder="#{message.user.fax}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.fax}" type="text">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-1 col-form-label my-font-bold"
                                   for="userName">[[#{message.user.code}]]<span
                                    style="color:red;">*</span></label>
                            <div class="col-sm-5">
                                <input class="form-control" id="code" name="code" placeholder="code"
                                       th:placeholder="#{message.user.code}"
                                       th:value="${sysUserSelected!=null}?${sysUserSelected.code}" type="text">
                            </div>
                        </div>

                        <div class="clr"></div>
                        <div class="hr-line-dashed"></div>
                        <div th:replace="common/bar::saveBtnGroup(data=${sysUserSelected})"></div>

                    </form>
                    <div class="clr"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--必须在bootstrap前引用-->
<script src="asserts/js/jquery.min.js" th:src="@{/asserts/js/jquery.min.js}" type="text/javascript"></script>
<script src="asserts/js/bootstrap.min.js" th:src="@{/asserts/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- Graphs -->
<script th:replace="common/myJs::myCommonJs"></script>
<script th:src="@{/asserts/js/layer/laydate/laydate.js}" type="text/javascript"></script>
<script src="asserts/js/layer/layer.min.js" th:src="@{/asserts/js/layer/layer.min.js}" type="text/javascript"></script>
<script src="asserts/js/bootstrap-table/bootstrap-table.min.js"
        th:src="@{/asserts/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
<script src="asserts/js/bootstrap-table/locale/bootstrap-table-zh-CN.js" th:if="${session.lang=='zh_CN'}"
        th:src="@{/asserts/js/bootstrap-table/locale/bootstrap-table-zh-CN.js}" type="text/javascript"></script>
<script src="asserts/js/tree-view/js/bootstrap-treeview.js" th:src="@{/asserts/js/tree-view/js/bootstrap-treeview.js}"
        type="text/javascript"></script>
<script src="asserts/js/jquery-file-upload.js" th:src="@{/asserts/js/jquery-file-upload.js}"
        type="text/javascript"></script>
<script src="asserts/js/bootstrap-select.min.js" th:src="@{/asserts/js/bootstrap-select.min.js}"
        type="text/javascript"></script>

<script th:inline="javascript">
    $(function () {
        let sysUserRoles = [[${sysUserSelected} ? ${sysUserSelected.sysUserRoles}]];
        if (sysUserRoles) {
            let arr = [];
            for (var a = 0, length = sysUserRoles.length; a < length; a++) {
                arr.push(sysUserRoles[a].roleId)
            }
            $('.roleSelectpicker').selectpicker('val', arr);
        }
        let sysUserAuditRoles = [[${sysUserSelected} ? ${sysUserSelected.sysUserAuditRoles}]];
        let arr2 = [];
        if (sysUserAuditRoles) {
            for (let a = 0, length = sysUserAuditRoles.length; a < length; a++) {
                arr2.push(sysUserAuditRoles[a].auditRoleId)
            }
            $('.auditRoleSelectpicker').selectpicker('val', arr2);
        }
        let sysUserDataRoles = [[${sysUserSelected} ? ${sysUserSelected.sysUserDataRoles}]];
        let arr3 = [];
        if (sysUserDataRoles) {
            for (let a = 0, length = sysUserDataRoles.length; a < length; a++) {
                arr3.push(sysUserDataRoles[a].roleId)
            }
            $('.dataRoleSelectpicker').selectpicker('val', arr3);
        }
    })
</script>

</body>
</html>
